/*
QAuthentee
Copyright (C) 2010  Pavel Mynarsky <admin@akia.se>

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
*/

#include "enrolldialog.h"
#include <QGraphicsItem>

EnrollDialog::EnrollDialog(QWidget *parent) : QDialog(parent)
{
    ui.setupUi(this);
    ui.progressBar->setValue(0);
    ui.buttonBox->button(QDialogButtonBox::Save)->setDisabled(true);
}

void EnrollDialog::setStatus(int status)
{
    switch(status)
    {
    case FP_ENROLL_COMPLETE:
        ui.statusLabel->setText(tr("Succeeded!"));
        ui.buttonBox->button(QDialogButtonBox::Save)->setEnabled(true);
        ui.progressBar->setValue(100);
        ui.buttonBox->button(QDialogButtonBox::Cancel)->setDisabled(true);
        break;
    case FP_ENROLL_FAIL:
        ui.statusLabel->setText(tr("Incomprehensible data"));
        break;
    case FP_ENROLL_PASS:
        ui.statusLabel->setText(tr("Passed, go to the next stage"));
        break;
    case FP_ENROLL_RETRY_TOO_SHORT:
        ui.statusLabel->setText(tr("Too short"));
        break;
    case FP_ENROLL_RETRY_CENTER_FINGER:
        ui.statusLabel->setText(tr("Not centered"));
        break;
    case FP_ENROLL_RETRY_REMOVE_FINGER:
        ui.statusLabel->setText(tr("Pressure problems"));
        break;
    case FP_ENROLL_RETRY:
        ui.statusLabel->setText(tr("Not successful!"));
        break;
    default:
        ui.statusLabel->setText(tr("Retry!"));
        break;
    }
}
